package proxirabais.mobile;

import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.widget.Toast;

import com.google.android.maps.MapController;

public class SimpleLocationListener implements LocationListener {

	private Context mContext;
	private MapController mapController;
	
	public SimpleLocationListener(Context context, MapController mapController) {
		super();
		this.mContext = context;
		this.mapController = mapController;
	}

	@Override
	public void onLocationChanged(Location location) {
		double lat = location.getLatitude();
		double lon = location.getLongitude();
		

		String Text = "location = lon : "+lon+" lat : "+lat;


		//Toast.makeText(mContext,Text,Toast.LENGTH_SHORT).show();
		//mapController.setCenter(new GeoPoint((int)(lat*1e6), (int)(lon*1e6)));
		//mapController.setZoom(15);		

	}

	@Override
	public void onProviderDisabled(String provider) {
		Toast.makeText( mContext,"Gps Disabled",	Toast.LENGTH_SHORT ).show();

	}

	@Override
	public void onProviderEnabled(String provider) {
		Toast.makeText( mContext,"Gps enabled",	Toast.LENGTH_SHORT ).show();

	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
		// TODO Auto-generated method stub

	}

}
